package com.woniu.cms.client.core.controller;


import com.woniu.cms.client.core.entity.OperaterType;
import com.woniu.cms.client.core.entity.TrustLevel;
import com.woniu.cms.client.core.service.IOperaterTypeService;
import com.woniu.cms.client.core.service.ITrustLevelService;
import com.woniu.common.api.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chenjiapeng
 * @since 2022-09-19
 */
@RestController
@RequestMapping("/operater-type")
@Api(tags = "查询所有运营商类型")
@Slf4j
public class OperaterTypeController {


    @Autowired
    private IOperaterTypeService iOperaterTypeService;


    @ApiOperation("查询所有的运营商类型")
    @GetMapping("all")
    public Result findProduct(){
        List<OperaterType> list = iOperaterTypeService.list();
        if (CollectionUtils.isEmpty(list)){
            return Result.error();
        }
        return Result.common(list);
    }



}

